package cli;

import java.awt.Font;
import java.awt.GridLayout;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import streams.TextAreaPrintStream;
import console.JConsole;


public class CLI_Runner {

	public static void main(String[] args) {
		new CLI_Runner();
	}
	
	public CLI_Runner() {	
		JFrame frame = new JFrame("Console");
		frame.setSize(800, 800);
		frame.setLayout(new GridLayout());
		JTextArea console = new JConsole();
		console.setFont(new Font(Font.MONOSPACED, 0, 12));
		JScrollPane s = new JScrollPane();
		s.setViewportView(console);
		frame.add(s);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
		frame.setLocationRelativeTo(null);
		
		TextAreaPrintStream newOut = new TextAreaPrintStream(console);
		System.setOut(newOut);
	}
	

}